home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-12-08 | 1.5 KB | 37 lines | [TEXT/GEOL] |
- Item forwarded by ALCABES to CPLUS.APPLE$ CP.ARCHIVES
-
- Item 9847949 1-Dec-89 20:27
-
- From: MIKE.VILOT ObjectWare, Michael Vilot,PRT
-
- To: D2022 Strata, Gary Bringhurst,PRT
-
- cc: CPLUS.DEV$ Cplus.Apple$ C++ Interest List--Developers
-
- Sub: Re: Multiple Inheritance
-
- > The question is this: is this style of programming simply obsolete when
- >multiple-inheritance is added to the language, or is there some way to avoid
- >the potential problems?
-
- The short answer is: No, that style of programming is not obsolete. You don't
- _have_ to use the multiple inheritance feature when it's not appropriate.
-
- >potential for traversing the same nodes of the DAG more than once. If class B
- >inherits from class A, and class C inherits from class A, and class D inherits
- >from classes B and C, what happens when we call class D's Draw method? Does
- >call both B's and C's Draw methods?
-
- Using multiple inheritance (at least with C++ public derivation) is stating
- that an object of class D is both "a kind of" B and "a kind of" C. The best
- way to make this work without ambiguity is to make sure that B's and C's are
- really _different_ "kinds of" things.
-
- That is, you probably don't want both paths to support a Draw() member
- function. If the multiple base classes are really very similar, then
- inheriting from them is bound to cause ambiguity and/or end up calling the
- common base's member more than once.
-
- Mike
-
-